package com.sunop.userservice.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * @author hutao666123
 * @since 2025-03-12
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("user")
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @TableField("name")
    @NotBlank
    private String name;

    @TableField("password")
    @NotBlank
    private String password;

    @TableField("avatar")
    private String avatar;

    @TableField("email")
    @Email
    private String email;

    /**
     * 学院
     */
    @TableField("department")
    private String department;

    /**
     * 班级
     */
    @TableField("class_name")
    private String className;

    @TableField("class_id")
    private Integer classId;

}
